#!/usr/bin/env python2 
#-*- coding:utf-8 -*-

CUSTOM_CODE_MAP = {
    #Lich
    1002: '进程异常退出',
    1004: '进程assert',
    1005: '连接 admin 失败',
    1006: "重启时间过长警告",
    1007: "集群心跳超时警告",
    1008: "网络fence失败",
    3000: "磁盘离线",
    3004: "磁盘读写错误",
    3005: "元数据读写错误",
#    3006: "磁盘损坏扇区个数",
#    3007: "暂时不支持的raid卡型号",
    4011: "设置虚拟 IP 错误",
    5005: "数据修复警告",
    5007: "数据加载警告",
#    5006: "volume",
    5008: "chunk数据加载警告",
    5006: '磁盘空间已满',
    6002: "授权信息错误",
    9100: "iSCSI服务错误",
    9200: "NBD服务错误",

    #Ump
    9001: '空间使用率超过80',
    9002: '管理系统没有和集群同网段的IP，监控假死节点功能不可用',
    9003: '发现假死节点，请联系相关专业人员处理',
    9004: '监控假死节点进程启动失败，监控假死节点功能不可用',
    9005: '数据恢复失败',
    9006: 'Total volumes number is over threshold',
    9007: 'Volume number in pool  is  over threshold',  
    9008: 'CPU usage of host is over threshold', 
    9009: 'Network bandwidth usage of host is over threshold',
    9010: 'Latency is over',
    9011: 'Memory usage of host is over threshold',
    9012: 'the sum of ec_data and ec_code biger than live host number',
    9013: 'the sum of ec_data and ec_code equal live host number',
    9014: '节点断网或关机',
}


SYSTEM_CODE_MAP = {
    1: u"操作不许可",
    2: u"无此文件或目录",
    3: u"无此过程",
    4: "系统调用被禁止",
    5: u"I/O 错误",
    6: u"无此设备或地址",
    7: u"列表太长",
    8: u"格式错误 ",
    9: u"文件数目错误",
   10: u"无子进程",
   11: u"资源暂不可用，请稍后重试",
   12: u"内存溢出",
   13: u"许可拒绝",
   14: u"错误的地址",
   15: u"需要块设备",
   16: u"设备或资源忙",
   17: u"文件已存在",
   18: u"跨文件系统链接",
   19: u"无此设备",
   20: u"不是一个目录",
   21: u"是一个目录",
   22: u"无效的函数自变量",
   23: u"文件表溢出",
   24: u"打开的文件太多",
   25: u"不合理的IO操作 ",
   26: u"文本文件忙 ",
   27: u"文件太大  ",
   28: u"磁盘空间不足 ",
   29: u"不合法的寻找  ",
   30: u"只读文件系统 ",
   31: u"太多的链接",
  137: u"进程被杀死",
}
